package com.xioyi.news.dao;

import java.io.Serializable;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;

/**
 * @author mickey
 * 
 */
public interface IBaseDAO<T, ID extends Serializable> {

	public T findObject(Integer objectId) throws SQLException;

	public abstract void saveOrUpdateObject(T t) throws SQLException;

	public abstract void saveObject(T t) throws SQLException;

	public abstract void updateObject(T t) throws SQLException;

	public abstract T getObject(String objectId) throws SQLException;

	public abstract T loadObject(ID objectId) throws SQLException;
	public abstract T findByObjectId(String objectId) throws SQLException;

	public abstract List<T> findAll(String querySql) throws SQLException;

	public abstract void deleteObject(T t) throws SQLException;

	public abstract List<T> findObject(String querySql) throws SQLException;

	public abstract List<T> findObject(String querySql, Object value)
			throws SQLException;

	public abstract List<T> findObject(String querySql, Object[] values)
			throws SQLException;

	public abstract List<T> findObjectByLimit(Map<String, String> condition,
			int firstResult, int maxResult) throws SQLException;

	public List<T> findObjectByLimit(Map<String, String> condition,
			final int firstResult, final int maxResult,
			Map<String, String> orderByMap) throws SQLException;
}
